]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Drop unnecessary libedataserverui dependency
authorMatthew Barnes <mbarnes@redhat.com>
Tue, 30 Oct 2012 17:42:43 +0000 (13:42 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Tue, 30 Oct 2012 18:18:39 +0000 (14:18 -0400)
The libedataserverui dependency is a relic of the old E-D-S API.
As of 3.6.0, E-D-S now centralizes authentication prompts so clients
don't have to display their own.  This also allows trading the GTK+
main loop for a plain GMainLoop in gnome-shell-calendar-server.c.

https://bugzilla.gnome.org/show_bug.cgi?id=687189

configure.ac
src/calendar-server/calendar-sources.c
src/calendar-server/gnome-shell-calendar-server.c

index 9eb3a0278e17739256c42ca72ea08b6674e8c018..eeed23657be2e6666515172e0f9fe9ded7ae48f1 100644 (file)
@@ -138,7 +138,7 @@ PKG_CHECK_EXISTS([gnome-bluetooth-1.0 >= 3.1.0],
         AC_SUBST([HAVE_BLUETOOTH],[0])
         AC_MSG_RESULT([no])])
 
-PKG_CHECK_MODULES(CALENDAR_SERVER, libecal-1.2 >= $LIBECAL_MIN_VERSION libedataserver-1.2 >= $LIBEDATASERVER_MIN_VERSION libedataserverui-3.0 >= $LIBEDATASERVERUI_MIN_VERSION gio-2.0)
+PKG_CHECK_MODULES(CALENDAR_SERVER, libecal-1.2 >= $LIBECAL_MIN_VERSION libedataserver-1.2 >= $LIBEDATASERVER_MIN_VERSION gio-2.0)
 AC_SUBST(CALENDAR_SERVER_CFLAGS)
 AC_SUBST(CALENDAR_SERVER_LIBS)
 
index c507f0fc2cab3796ae0df0b2f46686f95e739511..b0dbb2039cfb251dae5d4f4a1def8d871e500e28 100644 (file)
@@ -31,7 +31,6 @@
 #include <string.h>
 #define HANDLE_LIBICAL_MEMORY
 #include <libecal/libecal.h>
-#include <libedataserverui/libedataserverui.h>
 
 #undef CALENDAR_ENABLE_DEBUG
 #include "calendar-debug.h"
index 2ceb0585aa3564a9a5f6ea838e26b75b7fa3dbb7..bdbe1725993ae1ca8a5349b5c5460aa6a6631ce3 100644 (file)
@@ -34,7 +34,6 @@
 #include <unistd.h>
 
 #include <gio/gio.h>
-#include <gtk/gtk.h>
 
 #define HANDLE_LIBICAL_MEMORY
 #include <libecal/libecal.h>
@@ -985,9 +984,11 @@ on_name_lost (GDBusConnection *connection,
               const gchar     *name,
               gpointer         user_data)
 {
+  GMainLoop *main_loop = user_data;
+
   g_print ("gnome-shell-calendar-server[%d]: Lost (or failed to acquire) the name " BUS_NAME " - exiting\n",
            (gint) getpid ());
-  gtk_main_quit ();
+  g_main_loop_quit (main_loop);
 }
 
 static void
@@ -1003,11 +1004,13 @@ stdin_channel_io_func (GIOChannel *source,
                        GIOCondition condition,
                        gpointer data)
 {
+  GMainLoop *main_loop = data;
+
   if (condition & G_IO_HUP)
     {
       g_debug ("gnome-shell-calendar-server[%d]: Got HUP on stdin - exiting\n",
                (gint) getpid ());
-      gtk_main_quit ();
+      g_main_loop_quit (main_loop);
     }
   else
     {
@@ -1022,6 +1025,7 @@ main (int    argc,
 {
   GError *error;
   GOptionContext *opt_context;
+  GMainLoop *main_loop;
   gint ret;
   guint name_owner_id;
   GIOChannel *stdin_channel;
@@ -1031,9 +1035,7 @@ main (int    argc,
   name_owner_id = 0;
   stdin_channel = NULL;
 
-  /* We need to initialize GTK+ since evolution-data-server may decide to use
-   * GTK+ to pop up a dialog box */
-  gtk_init (&argc, &argv);
+  g_type_init ();
 
   introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
   g_assert (introspection_data != NULL);
@@ -1048,11 +1050,15 @@ main (int    argc,
       goto out;
     }
 
+  main_loop = g_main_loop_new (NULL, FALSE);
+
   stdin_channel = g_io_channel_unix_new (STDIN_FILENO);
-  g_io_add_watch (stdin_channel,
-                  G_IO_HUP,
-                  stdin_channel_io_func,
-                  NULL);
+  g_io_add_watch_full (stdin_channel,
+                       G_PRIORITY_DEFAULT,
+                       G_IO_HUP,
+                       stdin_channel_io_func,
+                       g_main_loop_ref (main_loop),
+                       (GDestroyNotify) g_main_loop_unref);
 
   name_owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
                                   BUS_NAME,
@@ -1061,10 +1067,12 @@ main (int    argc,
                                   on_bus_acquired,
                                   on_name_acquired,
                                   on_name_lost,
-                                  NULL,
-                                  NULL);
+                                  g_main_loop_ref (main_loop),
+                                  (GDestroyNotify) g_main_loop_unref);
+
+  g_main_loop_run (main_loop);
 
-  gtk_main ();
+  g_main_loop_unref (main_loop);
 
   ret = 0;